﻿using System;
using System.Drawing;
using System.Windows.Forms;

namespace ruscehproj2
{
    public partial class bsh001 : Form
    {
        int i = 1;
        int i2 =1;
        int i3 = 2;
        int i4 = 2;
        int i5 = 2;
        int angle1 = 0;
        bool isActive = false;
               
        public bsh001()
        {
            InitializeComponent();
        }

        public bool getState()
        {
            return isActive;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.i++;
            if (this.i > 4) this.i = 1;
            
            switch (this.i) 
            {
                case 1: button1.BackgroundImage = Resources.set01; break;
                case 2: button1.BackgroundImage = Resources.set02; break;
                case 3: button1.BackgroundImage = Resources.set03; break;
                case 4: button1.BackgroundImage = Resources.set04; break;
            }
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.i2++;
            if (this.i2 > 4) this.i2 = 1;
            {  
                switch (this.i2)
                {
                    case 1: button2.BackgroundImage = Resources.set01; break;
                    case 2: button2.BackgroundImage = Resources.set02; break;
                    case 3: button2.BackgroundImage = Resources.set03; break;
                    case 4: button2.BackgroundImage = Resources.set04; break;
                }
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
             this.i3++;
            if (this.i3 > 9) this.i3 = 1;
    
           
            switch (this.i3)
            {
                case 1: button3.BackgroundImage = Resources.set1; break;
                case 2: button3.BackgroundImage = Resources.set2; break;
                case 3: button3.BackgroundImage = Resources.set3; break;
                case 4: button3.BackgroundImage = Resources.set4; break;
                case 5: button3.BackgroundImage = Resources.set5; break;
                case 6: button3.BackgroundImage = Resources.set6; break;
                case 7: button3.BackgroundImage = Resources.set7; break;
                case 8: button3.BackgroundImage = Resources.set8; break;
                case 9: button3.BackgroundImage = Resources.set9; break;
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {            
            this.i4++;
            if (this.i4 > 10) this.i4 = 0;
          
         
  
            switch (this.i4)
            {
                case 0:{ button4.BackgroundImage = Resources.set0; angle1 = 42; break;}
                case 1:{ button4.BackgroundImage = Resources.set1; angle1 = 55; break;}
                case 2:{ button4.BackgroundImage = Resources.set2; angle1 = 77; break;}
                case 3:{ button4.BackgroundImage = Resources.set3; angle1 = 88; break;}
                case 4:{ button4.BackgroundImage = Resources.set4; angle1 = 99; break;}
                case 5:{ button4.BackgroundImage = Resources.set5; angle1 = 111; break;}
                case 6:{ button4.BackgroundImage = Resources.set6; angle1 = 115; break;}
                case 7:{ button4.BackgroundImage = Resources.set7; angle1 = 120; break;}
                case 8:{ button4.BackgroundImage = Resources.set8; angle1 = 125; break;}
                case 9: { button4.BackgroundImage = Resources.set9; angle1 = 125; break; }
                case 10: { button4.BackgroundImage = Resources.set10; angle1 = 125; break; }
            }
            
   
       
         
            
        }

        private void button5_Click(object sender, EventArgs e)
        {

            this.i5++;
            if (this.i5 > 10) this.i5 = 0;
           
        
            switch (this.i5)
            {
                case 0: button5.BackgroundImage = Resources.set0; FormManager.BSH002.angle1 = 42; break;
                case 1: button5.BackgroundImage = Resources.set1; FormManager.BSH002.angle1 = 45; break;
                case 2: button5.BackgroundImage = Resources.set2; FormManager.BSH002.angle1 = 55; break;
                case 3: button5.BackgroundImage = Resources.set3; FormManager.BSH002.angle1 = 66; break;
                case 4: button5.BackgroundImage = Resources.set4; FormManager.BSH002.angle1 = 77; break;
                case 5: button5.BackgroundImage = Resources.set5; FormManager.BSH002.angle1 = 88; break;
                case 6: button5.BackgroundImage = Resources.set6; FormManager.BSH002.angle1 = 99; break;
                case 7: button5.BackgroundImage = Resources.set7; FormManager.BSH002.angle1 = 100; break;
                case 8: button5.BackgroundImage = Resources.set8; FormManager.BSH002.angle1 = 105; break;
                case 9: button5.BackgroundImage = Resources.set9; FormManager.BSH002.angle1 = 110; break;
                case 10: button5.BackgroundImage = Resources.set10; FormManager.BSH002.angle1 = 120; break;
            }
        
      
        }

        private void Form2_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                this.Hide();
            }
        }



        private void vkl_Click(object sender, EventArgs e)
        {
            if (FormManager.bv2dal.getState())
            {
                isActive = true;
                FormManager.hlp.setHelpId("end");
                FormManager.hlp.hlpRefresh();
            }
        }

        private void bsh001_Load(object sender, EventArgs e)
        {
            if (FormManager.hlp.helpEnabled())
            {
                if (FormManager.bv2dal.getState())
                {
                    if (isActive)
                    {
                        FormManager.hlp.setHelpId("end");
                    }
                    else FormManager.hlp.setHelpId("vkl");
                    FormManager.hlp.hlpRefresh();
                }
                else
                {
                    FormManager.hlp.notSoFast();
                }



                FormManager.hlp.Show();
            }
            
        }

        private void bsh001_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (isActive) FormManager.hlp.setHelpId("6");
            FormManager.hlp.Hide();
        }

    


        }

}
